﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<List<kysec.RAL.EFToMySql.tb_message>>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>SearchMsg</title>
     <%string type = Request.QueryString["type"].ToString(); string isUpdate = Request.QueryString["isUpdate"];%>
    <script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <link href="../../Content/back/css/skin.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function submitReplay() {
            if ($("c_ntx_content").val() == '') {
                alert("回复信息不能为空！");
            } else {
                $.ajax({
                    url: "/Message/AddRepalyMsg",
                    type: "post",
                    cache: false,
                    data: "id=" + $("#id").val() + "&c_ntx_content=" + $("#c_ntx_content").val(),
                    success: function (result) {
                        if (result == "1") {
                            alert("回复成功！");
                            window.location.href = "<%:kysec.CR.MyUrl.WebData.WEBURL %>/Message/InfoList?type=<%=type %>";
                        }
                        if (result == "0") {
                            alert("回复失败！");
                        }
                    }
            });
        }
        }
        function reSet() {
            $("#c_ntx_content").val('');
        }
        function deleteMsg() {
            if (confirm("确认删除此留言信息？")) {
                $.ajax({
                    url: "/Message/DeleteOne",
                    type: "post",
                    cache: false,
                    data: "id=" + $("#id").val(),
                    success: function (result) {
                        if (result == "1") {
                            alert("删除成功！");
                            window.location.href = "<%:kysec.CR.MyUrl.WebData.WEBURL %>/Message/InfoList?type=<%=type %>";
                        }
                        if (result == "0") {
                            alert("删除失败！");
                        }
                    }
                });
            }

        }
        <% if(isUpdate.Equals("0")){%>
        $(function () { $("#replay").hide(); });

        function showReplay() {
            $("#replay").show();
        }
        <%} %>
    </script>
</head>
<body>
    <form id="form1" method="post" runat="server">
    <div>
     <%string type=Request.QueryString["type"].ToString();
  string id = Request.QueryString["id"].ToString();
         string isUpdate1 = Request.QueryString["isUpdate"]; %>
    <input type="hidden" id="id" value="<%=id %>"/>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" height="29" valign="top" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_leftbg.gif") %>"><img src="<%=Url.Content

(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/left-top-right.gif") %>" width="17" height="29" /></td>
    <td width="100%" height="29" valign="top" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/content-bg.gif") %>"><table width="100%" 

height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt"><%if (type.Equals("0"))
                                               {%>技术反馈<%}
                                               else if(type.Equals("1"))
                                               { %>用户留言<%} %></div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_rightbg.gif") %>"><img src="<%=Url.Content

(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/nav-right-bg.gif") %>" width="16" height="29" /></td>
  </tr>

  <tr>
    <td height="71" valign="middle" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_leftbg.gif") %>">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9"><table border="0" cellpadding="0" cellspacing="0"> 
     <tr>
            <td class="left_txt">当前位置：<% if (type.Equals("0"))
                                        { %><a href="<%:kysec.CR.MyUrl.WebData.WEBURL %>/Message/InfoList?type=<%:type %>">技术反馈列表</a><%}
                                        else if(type.Equals("1"))
                                        { %><a href="<%:kysec.CR.MyUrl.WebData.WEBURL %>/Message/InfoList?type=<%:type %>">用户留言列表</a><%} %>  >>  查看信息</td>
      </tr></table>
   <div style="background-color:#97b9f0;height:1px;margin-bottom:10px;"></div>

        <div style="text-align:center;">
        <input id="c_i_classify " name="c_i_classify " value="<%:type %>" type="hidden"/>
           <div style="margin-top:10px; " >
           <%if (Model == null)
             { %><span style="color:Red;font-size:xx-large;">操作有误，请正确操作……</span><a href="<%=kysec.CR.MyUrl.WebData.WEBURL %>/Message/InfoList?type=<%=type %>" title="点击返回用户列表" 

style="margin-left:10px;">返回</a><%}
             else
             {
                 foreach (var item in Model)
                 { %>
            <table border="0" cellpadding="1" cellspacing="0" width="100%" >
             <tr style="height:50px;" bgcolor="#d3ebf8">
                <td  width="80%"><div><label>姓氏：<%=item.c_vc_name %></label><label style="margin:0px 20px 0px 20px;">电话号码：<%=item.c_vc_phone %></label><label>发布时间：<%=item.c_dt_publishedTime %></label></div> </td>  
                 <td  align="left"><div class="td_Left">&nbsp;</div></td>              
            </tr>
             <tr style="height:50px;" bgcolor="#97b9f0">
                <td  width="80%"><div><label>传真：<%=item.c_vc_fax %></label><label>邮箱：<%=item.c_vc_emial %></label></div> </td>
                <td  align="left"><div class="td_Left"><span>&nbsp;</span></div></td>
            </tr>
            <tr  style="height:50px;" bgcolor="#d3ebf8">
                <td width="80%" ><div><label>主题：<%=item.c_vc_title %></label></div></td>
                <td align="left"><div class="td_Left"><span>&nbsp;</span></div></td>
            </tr>
            
            <tr style="height:50px;" bgcolor="#97b9f0">
                <td width="80%"><div><label>内容：<%=item.c_ntx_content.ToString() %></label></div> </td>
                <td align="left"><span>&nbsp;</span></td>
            </tr>
            <tr><td colspan="2" bgcolor="#97b9f0" align="center"><%if (isUpdate1.Equals("0"))
                                                                   { %><a href="javascript:;" onclick="showReplay();">点击回复</a><%} %><div id="replay"><div ><textarea rows="5" cols="80" id="c_ntx_content"></textarea></div><div><a href="javascript:;" onclick="submitReplay();">回复</a><a href="javascript:;" onclick="reSet();" style="margin:0px 20px 0px 0px;">重置</a></div></div></td></tr>
            </table><%}
             } %></div>
            <div style="min-height:1px; width:100%; background-color:#97b9f0;">&nbsp;</div>
            <p>
                <a href="javascript:;" onclick="deleteMsg();" style="margin:0px 0px 0px 20px;">删除</a>
                <a href="<%=kysec.CR.MyUrl.WebData.WEBURL %>/Message/InfoList?type=<%:type %>">确认</a>  
            </p>
        </div>
     </td>
    <td background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_rightbg.gif") %>">&nbsp;</td>
  </tr>
  <tr>
    <td valign="middle" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_leftbg.gif") %>"><img src="<%=Url.Content

(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/buttom_left2.gif") %>" width="17" height="17" /></td>
      <td  valign="top" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/buttom_bgs.gif") %>"><img src="<%=Url.Content

(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/buttom_bgs.gif") %>" width="17" height="17" /></td>
    <td background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_rightbg.gif") %>"><img src="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + 

"/Content/back/images/buttom_right2.gif") %>" width="16" height="17" /></td>
  </tr>
</table>
    </div>
    </form>
</body>
</html>
